//
//  ZVideoMidTableViewCell.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/22.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZVideoMidTableViewCell.h" 

#import "LZCollectionView.h"
#import "ZDoctorView.h"
@interface ZVideoMidTableViewCell ()<LZCollectionViewDelegate> {
    UILabel * _theTitleLabel;//视频介绍
    UILabel * _contextLabel; // 详情介绍
    UILabel * _recommendLabel;// 相似推荐
    LZCollectionView * _LzcollView; //滚动
}
@end
@implementation ZVideoMidTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initlizeInterface];
    }
    return self;
}

- (void)setZpModel:(ZPalyVModel *)zpModel {
    _zpModel = zpModel;
    _contextLabel.text = zpModel.info;
}
- (void)setRecommendArray:(NSMutableArray<ZRecommendModel *> *)recommendArray {
    _recommendArray = recommendArray;
    _LzcollView.rArray = _recommendArray;
}
- (void)initlizeInterface {
    [self makeAllSubView];
    [self addAllSubView];
    [self makeAllSubViewMasnoy];
}

- (void)makeAllSubView {
    _theTitleLabel = [[UILabel alloc] init];
    _theTitleLabel.text = @"视频介绍";
    _theTitleLabel.font = [UIFont systemFontOfSize:16];
    _contextLabel = [[UILabel alloc] init];
    _contextLabel.text = @"";
    _recommendLabel = [[UILabel alloc] init];
    _recommendLabel.text = @"相似推荐";
    _recommendLabel.font = [UIFont systemFontOfSize:16];
    _LzcollView = [[LZCollectionView alloc] init];
    _LzcollView.lzcDelegate = self;
}

- (void)addAllSubView {
    [self.contentView addSubview:_theTitleLabel];
    [self.contentView addSubview:_contextLabel];
    [self.contentView addSubview:_recommendLabel];
    [self.contentView addSubview:_LzcollView];
}

- (void)makeAllSubViewMasnoy {
    [_theTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(10*xsIZE);
        make.top.equalTo(self.contentView).offset(15*ysIZE);
        make.height.offset(16*ysIZE);
        make.width.offset(100*xsIZE);
    }];
    [_contextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_theTitleLabel);
        make.right.equalTo(self.contentView).offset(-10*xsIZE);
        make.height.offset(72.5*ysIZE);
        make.top.equalTo(_theTitleLabel.mas_bottom);
    }];
    [_recommendLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_theTitleLabel);
        make.width.equalTo(_theTitleLabel);
        make.height.equalTo(_theTitleLabel);
        make.top.equalTo(_theTitleLabel.mas_bottom).offset(72.5*ysIZE);
    }];
    [_LzcollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.top.equalTo(_recommendLabel.mas_bottom).offset(10*ysIZE);
        make.bottom.equalTo(self);
    }];
}
//- (void)didSeletWithRow:(NSInteger)row {
//    !self.selcetVideoBlock? :self.selcetVideoBlock(_zpModel);
//
//}
- (void)didSeletWithRow:(NSInteger)row withVid:(NSString *)vid {
    !self.selcetVideoBlock? :self.selcetVideoBlock(&row,vid);
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
